﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
        <link type="text/css" rel="stylesheet" media="all" href="../styles/global.css" />
        <link type="text/css" rel="stylesheet" media="all" href="../styles/global_color.css" />
        <script src="../js/jquery-3.2.1.js"></script>
        <script language="javascript" type="text/javascript">
            urlinfo = window.location.href; //获取当前页面的url
            len = urlinfo.length;//获取url的长度
            offset = urlinfo.indexOf("?");//设置参数字符串开始的位置
            newsidinfo = urlinfo.substr(offset, len)//取出参数字符串 这里会获得类似“id=1”这样的字符串
            newsids = newsidinfo.split("=");//对获得的参数字符串按照“=”进行分割
            sid = newsids[1];//得到参数值
            newsname = newsids[0];//得到参数名字

            $.ajax({
                url: "/selectAllModules",
                type: "post",
                success: function (result) {
                    console.log(result)

                    if (result.indexOf("角色管理") == -1) {
                        document.getElementById("lia1").style.display = "none"
                    }
                    if (result.indexOf("管理员管理") == -1) {
                        document.getElementById("lia2").style.display = "none"
                    }
                    if (result.indexOf("资费管理") == -1) {
                        document.getElementById("lia3").style.display = "none"
                    }
                    if (result.indexOf("账务账号管理") == -1) {
                        document.getElementById("lia4").style.display = "none"
                    }
                    if (result.indexOf("业务账号管理") ==-1) {
                        document.getElementById("lia5").style.display = "none"
                    }
                    if (result.indexOf("账单管理") ==-1) {
                        document.getElementById("lia6").style.display = "none"
                    }
                    if (result.indexOf("报表管理") == -1) {
                        document.getElementById("lia7").style.display = "none"
                    }
                }
            });


            $.ajax({
                url:"selectservice",
                type:"post",
                data:{
                    serviceId:sid,
                },
                success:function (result) {
                    console.log(result)
                    var service = result.data;
                    var account = service.account;
                    var cost = service.cost;

                    $("#serviceid").val(service.serviceId);
                    $("#accountid").val(account.accountId);
                    $("#accountname").val(account.realName);
                    $("#cardid").val(account.idcardNo);
                    $("#ip").val(service.unixHost);
                    $("#osname").val(service.osUsername);
                    $("#"+service.status).attr("selected",true);

                    $("#createdate").val(service.createDate);
                    $("#costid").val(cost.costId);
                    $("#costname").val(cost.name);
                    $("#costdesc").val(cost.descr);
                }
            })
        </script>
    </head>
    <body>
        <!--Logo区域开始-->
        <div id="header">
            <img src="../images/logo.png" alt="logo" class="left"/>
            <a href="/logout">[退出]</a>
        </div>
        <!--Logo区域结束-->
        <!--导航区域开始-->
        <div id="navi">
            <ul id="menu">
                <li><a href="../index.html" class="index_off"></a></li>
                <li id="lia1"><a href="rolelist" class="role_off"></a></li>
                <li id="lia2"><a href="adminlist" class="admin_off"></a></li>
                <li id="lia3"><a href="fee" class="fee_off"></a></li>
                <li id="lia4"><a href="accountlist" class="account_off"></a></li>
                <li id="lia5"><a href="servicelist" class="service_on"></a></li>
                <li id="lia6"><a href="bill" class="bill_off"></a></li>
                <li id="lia7"><a href="report" class="report_off"></a></li>
                <li><a href="userinfo" class="information_off"></a></li>
                <li><a href="changepsw" class="password_off"></a></li>
            </ul>
        </div>
        <!--导航区域结束-->
        <!--主要区域开始-->
        <div id="main">
            <form action="" method="" class="main_form">
                <!--必填项-->
                <div class="text_info clearfix"><span>业务账号ID：</span></div>
                <div class="input_info"><input type="text" value="" id="serviceid" readonly class="readonly" /></div>
                <div class="text_info clearfix"><span>账务账号ID：</span></div>
                <div class="input_info"><input type="text" value="" id="accountid" readonly class="readonly" /></div>
                <div class="text_info clearfix"><span>客户姓名：</span></div>
                <div class="input_info"><input type="text" readonly id="accountname" class="readonly" value="" /></div>
                <div class="text_info clearfix"><span>身份证号码：</span></div>
                <div class="input_info"><input type="text" readonly id="cardid" class="readonly" value="" /></div>
                <div class="text_info clearfix"><span>服务器 IP：</span></div>
                <div class="input_info"><input type="text" value="" id="ip" readonly class="readonly" /></div>
                <div class="text_info clearfix"><span>OS 账号：</span></div>
                <div class="input_info"><input type="text" value="" id="osname" readonly class="readonly" /></div>
                <div class="text_info clearfix"><span>状态：</span></div>
                <div class="input_info">
                    <select disabled id="status" >
                        <option id="1" >开通</option>
                        <option id="2" >暂停</option>
                        <option id="3" >删除</option>
                    </select>
                </div>
                <div class="text_info clearfix"><span>开通时间：</span></div>
                <div class="input_info"><input type="text" readonly id="createdate" class="readonly" /></div>
                <div class="text_info clearfix"><span>资费 ID：</span></div>
                <div class="input_info"><input type="text" class="readonly" id="costid" readonly /></div>
                <div class="text_info clearfix"><span>资费名称：</span></div>
                <div class="input_info"><input type="text" readonly id="costname" class="width200 readonly" /></div>
                <div class="text_info clearfix"><span>资费说明：</span></div>
                <div class="input_info_high">
                    <textarea class="width300 height70 readonly" id="costdesc" readonly> </textarea>
                </div>
                <!--操作按钮-->
                <div class="button_info clearfix">
                    <input type="button" value="返回" class="btn_save" onclick="location.href='servicelist';" />
                </div>
            </form>
        </div>
        <!--主要区域结束-->
        <div id="footer">
            <span>[源自北美的技术，最优秀的师资，最真实的企业环境，最适用的实战项目]</span>
            <br />
             <span>版权所有(C)云科技有限公司 </span>
        </div>
    </body>
</html>
